<!DOCTYPE html>
<html lang="zh-CN">
@include('index.head')
<body>
@include('index.topNav')
@if(session('__Ajax_RedirectFunc_status') == true)
    <div>
        <div class="alert alert-success alert-dismissible fade in" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <h3>成功</h3>
            <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
            <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
        </div>
    </div>
@endif
@if(session('__Ajax_RedirectFunc_status') === false)
    <div >
        <div class="alert alert-danger alert-dismissible fade in" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <h3>失败</h3>
            <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
            <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
        </div>
    </div>
@endif

<div class="container">
    <div class="row">
        <div class="col-md-12" >
            <div class="col-md-5">
                <div class=" panel panel-default">
                    <div class="panel-body">
                        <img src="{{asset("/images/$shopData->shop_img")}}" style="width: 100%">
                        <h3>{{$shopData->shop_name}} <a href="" class="btn btn-sm btn-danger pull-right">收藏</a></h3>
                        <br>
                        电话：{{$shopData->shop_phone}}
                        <br><br>
                        已服务过<span style="color: red"> {{$shopData->shop_number}} </span>人次<br><br>
                        已有<span style="color: red"> {{$shopData->shop_keep_num}} </span>人收藏

                    </div>
                </div>
            </div>
            <div class="col-md-7">
                <div class=" panel panel-default">
                    <div class="panel-body">
                        <h2>地址：{{ $shopData->shop_address }}</h2>
                        <hr>
                        <div id="mapContainer" style="width: 606px;height: 393px"></div>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-body">
                    <h4>业务</h4>
                    <hr>
                    <div class="col-md-12">
                        @foreach($serviceData as $data)
                            <div class="col-md-12" style="text-align: center">
                                <div class="col-md-7" style="background: #2D93CA;height: 50px">
                                    <p></p>
                                    <a href="/serviceInfo/{{$data->service_id}}" style="color: white;font-size: 24px">{{$data->service_name}}</a>
                                </div>
                                <div class="col-md-3" style="background:#ffb312;height: 50px">
                                    <br>
                                    <p style="color: red">{{$data->service_price}} 元 / 张</p>
                                </div>
                                <div class="col-md-2" style="background:red;height: 50px">
                                    <p></p>
                                    <p style="color: white;font-size: 24px">{{$data->service_number}}人已购买</p>
                                </div>
                            </div>
                            <div class="col-md-12" style="height: 5px"></div>
                        @endforeach
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
</body>
<script type="text/javascript"
        src="https://webapi.amap.com/maps?v=1.4.2&key=3d54bcb1eed23ed8bc14dad4e686892d"></script>
<script type="text/javascript">
    var map = new AMap.Map("mapContainer", {
        resizeEnable: true
    });
    AMap.service(["AMap.PlaceSearch"], function() {
        var placeSearch = new AMap.PlaceSearch({ //构造地点查询类
            pageSize: 5,
            pageIndex: 1,
            city: "{{ $shopData->shop_city }}", //城市
            map: map//,
            //panel: "panel"
        });
        //关键字查询
        placeSearch.search('{{ $shopData->shop_address }}', function(status, result) {
        });
    });
</script>
</html>